home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-avt-rtp-03.txt < prev    next >
Text File  |  1993-09-15  |  90KB  |  2,087 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Internet Engineering Task Force                Audio-Video    Transport WG
  8. INTERNET-DRAFT draft-ietf-avt-rtp-03.txt        H. Schulzrinne/S. Casner
  9.                                     AT&T/ISI
  10.                               September 15,    1993
  11.                               Expires:  11/01/93
  12.  
  13.  
  14.         RTP: A Transport Protocol for Real-Time Applications
  15.  
  16.  
  17.  
  18. Status of this Memo
  19.  
  20.  
  21. This document is an Internet Draft.   Internet Drafts are working  documents
  22. of the Internet    Engineering  Task Force    (IETF),    its  Areas, and    its  Working
  23. Groups.      Note that other  groups may also  distribute working documents  as
  24. Internet Drafts.
  25.  
  26. Internet Drafts     are draft  documents valid  for a  maximum of    six  months.
  27. Internet Drafts    may be    updated, replaced, or  obsoleted by other  documents
  28. at any time.   It  is not appropriate  to use Internet    Drafts as  reference
  29. material or to    cite them other     than as  a ``working draft''  or ``work  in
  30. progress.''
  31.  
  32. Please check  the I-D  abstract     listing contained  in each  Internet  Draft
  33. directory to learn the current status of this or any other Internet Draft.
  34.  
  35. Distribution of    this document is unlimited.
  36.  
  37.  
  38.                   Abstract
  39.  
  40.  
  41.      This  memorandum describes    a protocol called  RTP suitable    for the
  42.     end-to-end    network    transport  of real-time     data,    such  as audio,
  43.     video or simulation     data for both multicast  and unicast transport
  44.     services.    The data transport  is augmented by  a control protocol
  45.     (RTCP)  designed  to  provide minimal  control  and     identification
  46.     functionality particularly in multicast networks.  RTP and RTCP are
  47.     designed to    be independent of  the underlying transport and    network
  48.     layers.  The protocol supports the use of RTP-level    translators and
  49.     bridges.   Within multicast    associations, sites  can direct    control
  50.     messages  to individual  sites.    The  protocol  does not    address
  51.     resource reservation and does  not guarantee quality-of-service for
  52.     real-time services.
  53.  
  54.  
  55. This specification is a    product     of the    Audio-Video Transport working  group
  56. within the Internet  Engineering Task  Force.    Comments  are solicited     and
  57.  
  58.  
  59. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  60.  
  61. should be addressed to the  working group's mailing list at  rem-conf@es.net
  62. and/or the authors.
  63.  
  64.  
  65.  
  66. Contents
  67.  
  68.  
  69. 1 Introduction                                   3
  70.  
  71. 2 RTP Protocol Use Scenarios                           5
  72.  
  73.   2.1 Simple Multicast Audio Conference    . . . .    . . . .    . . . .    . . . .    . 5
  74.  
  75.   2.2 Bridges .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 6
  76.  
  77.   2.3 Translators . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 6
  78.  
  79.   2.4 Security    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    .  7
  80.  
  81.  
  82. 3 Definitions                                   7
  83.  
  84. 4 Byte Order, Alignment, and Reserved Values                  10
  85.  
  86.  
  87. 5 Real-Time Data Transfer Protocol -- RTP                  10
  88.  
  89.   5.1 RTP Fixed    Header Fields .    . . . .    . . . .    . . . .    . . . .    . . . .    . 10
  90.  
  91.   5.2 The RTP Options .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 12
  92.  
  93.     5.2.1CSRC: Content source identifiers . . .    . . . .    . . . .    . . . .    . 13
  94.  
  95.     5.2.2SSRC: Synchronization source identifier  . . .    . . . .    . . . .    . 13
  96.  
  97.     5.2.3BOS: Beginning    of synchronization unit    . . . .    . . . .    . . . .    . 14
  98.  
  99.   5.3 Reverse-Path Option . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 14
  100.  
  101.     5.3.1SDST: Synchronization destination identifier .    . . . .    . . . .    . 15
  102.  
  103.   5.4 Security Options    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 16
  104.  
  105.     5.4.1ENC: Encryption  . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 18
  106.  
  107.     5.4.2MIC: Messsage integrity check    . . . .    . . . .    . . . .    . . . .    . 19
  108.  
  109.     5.4.3MICA: Message integrity check,    asymmetric encryption .    . . . .    . 20
  110.  
  111.     5.4.4MICK: Message integrity check,    keyed .    . . . .    . . . .    . . . .    . 21
  112.  
  113.  
  114. H. Schulzrinne/S. Casner          Expires 11/01/93            [Page 2]
  115.  
  116.  
  117. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  118.  
  119.     5.4.5MICS: Message integrity check,    symmetric-key encrypted    . . . .    . 22
  120.  
  121.  
  122. 6 Real Time Control Protocol --- RTCP                      22
  123.  
  124.   6.1 FMT: Format description .    . . . .    . . . .    . . . .    . . . .    . . . .    . 23
  125.  
  126.   6.2 SDES: Source descriptor .    . . . .    . . . .    . . . .    . . . .    . . . .    . 24
  127.  
  128.   6.3 BYE: Goodbye  . .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 27
  129.  
  130.   6.4 QOS: Quality of service measurement . . .    . . . .    . . . .    . . . .    . 27
  131.  
  132. 7 Security Considerations                          28
  133.  
  134.  
  135. 8 RTP over Network and Transport Protocols                  29
  136.  
  137.   8.1 Defaults    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 29
  138.  
  139.   8.2 ST-II . .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 30
  140.  
  141. A Implementation Notes                              30
  142.  
  143.   A.1 Timestamp    Recovery  . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 31
  144.  
  145.   A.2 Detecting    the Beginning of a Synchronization Unit    . . . .    . . . .    . 32
  146.  
  147.   A.3 Demultiplexing and Locating the Synchronization Source  .    . . . .    . 33
  148.  
  149.   A.4 Parsing RTP Options . . .    . . . .    . . . .    . . . .    . . . .    . . . .    . 33
  150.  
  151.   A.5 Determining the Expected Number of RTP Packets  .    . . . .    . . . .    . 34
  152.  
  153.  
  154. B Addresses of Authors                              35
  155.  
  156.  
  157. 1 Introduction
  158.  
  159.  
  160. This memorandum    specifies a  transport protocol    for real-time  applications.
  161. A discussion of    real-time services  and    algorithms for their  implementation
  162. and some of the     RTP design decisions  can be found  in    the current  version
  163. of the    companion  Internet  draft draft-ietf-avt-issues.     The  transport
  164. protocol provides  end-to-end  delivery     services for  data  with  real-time
  165. characteristics, for  example,    interactive audio  and video.     RTP  itself
  166. does not provide any  mechanism    to ensure timely  delivery or provide  other
  167. quality-of-service guarantees, but relies on lower-layer services to do     so.
  168. It does    ___ guarantee  delivery    or prevent  out-of-order delivery, nor    does
  169. it assume that the  underlying network is reliable  and    delivers packets  in
  170.  
  171.  
  172. H. Schulzrinne/S. Casner          Expires 11/01/93            [Page 3]
  173.  
  174.  
  175. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  176.  
  177. sequence.   The    sequence numbers  included in  RTP allow the  end system  to
  178. reconstruct the    sender's packet     sequence, but    sequence numbers might    also
  179. be used    to determine the proper    location  of a packet, for example in  video
  180. decoding, without necessarily decoding    packets    in sequence.   RTP does     not
  181. provide    quality-of-service guarantees.     RTP  is designed to  run on top  of
  182. a variety of  network and  transport protocols,     for example,  IP, ST-II  or
  183. UDP.(1)    RTP  transfers data  in    a  single  direction, possibly    to  multiple
  184. destinations if     supported by  the  underlying network.       A  mechanism     for
  185. sending    control    data in    the opposite direction,    reversing the path traversed
  186. by regular data, is provided.
  187.  
  188. While RTP is primarily    designed to satisfy  the needs of  multi-participant
  189. multimedia conferences,    it  is not limited  to that particular    application.
  190. Storage    of  continuous    data,  interactive  distributed     simulation,  active
  191. badge,    and  control  and   measurement     applications  may  also  find     RTP
  192. applicable.   Profiles are  used to  instantiate certain  header fields     and
  193. options    for particular sets of applications.  A    profile    for audio and  video
  194. data may be found in the companion Internet draft draft-ietf-avt-profile.
  195.  
  196. The current  Internet  does not     support  the widespread  use  of  real-time
  197. services.     High-bandwidth  services    using    RTP,  such  as    video,     can
  198. potentially seriously degrade other  network services.     Thus,    implementors
  199. should take  appropriate precautions  to limit    accidental bandwidth  usage.
  200. Application  documentation  should  clearly  outline  the  limitations     and
  201. possible operational  impact of     high-bandwidth     real-time services  on     the
  202. Internet and other network services.
  203.  
  204. This document defines a    packet format shared by    two protocols:
  205.  
  206.  
  207.   o the    real-time  transport protocol  (RTP),  for exchanging  data that  hs
  208.     real-time  properties.    The  RTP    header consists     of  a    fixed-length
  209.     portion plus optional control fields;
  210.  
  211.   o the    RTP  control protocol  (RTCP), for conveying  information about     the
  212.     participants  in an     on-going  session.    RTCP consists  of  additional
  213.     header options  that may  be ignored  without affecting  the ability  to
  214.     receive  data correctly.     RTCP  is used    for  ``loosely    controlled''
  215.     sessions,  i.e.,  where there  is  no explicit  membership    control     and
  216.     set-up.    Its  functionality  may    be subsumed  by     a  session  control
  217.     protocol, which is beyond the scope    of this    document.
  218.  
  219. ------------------------------
  220.  1. For    most  applications, RTP     offers    insufficient  demultiplexing to     run
  221. directly on IP.
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. H. Schulzrinne/S. Casner          Expires 11/01/93            [Page 4]
  231.  
  232.  
  233. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  234.  
  235. 2 RTP Protocol Use Scenarios
  236.  
  237.  
  238. The following sections describe    some aspects of    the use    of RTP.    The examples
  239. were chosen to    illustrate the    basic operation    of  applications using    RTP,
  240. not to    limit  what RTP     may  be  used for.    In  these  examples,  RTP  is
  241. carried    on top    of IP and  UDP,    and follows  the conventions established  by
  242. the profile for    audio  and video specified in  the companion Internet  draft
  243. draft-ietf-avt-profile.
  244.  
  245.  
  246.  
  247. 2.1 Simple Multicast Audio Conference
  248.  
  249.  
  250. A working group     of the     IETF meets to    discuss    the  latest protocol  draft,
  251. using the IP multicast    services of the     Internet for voice  communications.
  252. Through    some  allocation  mechanism,  the  working  group  chair  obtains  a
  253. multicast group     address;  all participants  use  the destination  UDP    port
  254. specified by the profile.   The    multicast address and port are    distributed,
  255. say, by    electronic mail, to all     intended participants.     The mechanisms     for
  256. discovering available multicast    addresses  and distributing the     information
  257. to participants    are beyond the scope of    RTP.
  258.  
  259. The audio conferencing application used    by each    conference participant sends
  260. audio data in small  chunks of,    say, 20     ms duration.    Each chunk of  audio
  261. data is    preceded by an RTP header; RTP header and data are in turn contained
  262. in a UDP packet.   The    Internet, like    other packet networks,    occasionally
  263. loses and reorders packets and delays them by variable amounts of time.      To
  264. cope with these    impairments, the RTP header contains timing information     and
  265. a sequence number that    allow the receivers to    reconstruct the    timing    seen
  266. by the source, so that,     in our    case, a    chunk  of audio    is delivered to     the
  267. speaker    every 20 ms.  The sequence  number can also be used by the  receiver
  268. to estimate how    many packets are being lost.  Each RTP packet also indicates
  269. what type of  audio encoding  (such as    PCM, ADPCM  or GSM)  is    being  used,
  270. so that    senders    can  change the    encoding during     a conference, for  example,
  271. to accommodate a new participant  that is connected through a  low-bandwidth
  272. link.
  273.  
  274. Since members of the working group join    and leave during the conference,  it
  275. is useful to know  who is participating     at any    moment.      For that  purpose,
  276. each instance  of  the    audio application  in  the  conference    periodically
  277. multicasts the name, email address and other information of its    user.    Such
  278. control    information is    carried    as  RTCP SDES options  within RTP  messages,
  279. with or     without audio    data (see  Section 6.2).    These periodic  messages
  280. also provide some indication as    to  whether the    network    connection is  still
  281. functioning.   A  site    sends the  RTCP    BYE  (Section  6.3) option  when  it
  282. leaves a conference.  The RTCP    QOS (Section 6.4) option indicates how    well
  283. the current speaker is    being received and may    be used    to control  adaptive
  284. encodings.
  285.  
  286.  
  287.  
  288. H. Schulzrinne/S. Casner          Expires 11/01/93            [Page 5]
  289.  
  290.  
  291. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  292.  
  293. 2.2 Bridges
  294.  
  295.  
  296. So far,    we have     assumed that all  sites want to receive  audio    data in     the
  297. same format.    However,  this may  not     always    be  appropriate.    Consider
  298. the case where participants  in    one area are  connected    through    a  low-speed
  299. link to    the majority  of the conference     participants, who enjoy  high-speed
  300. network    access.       Instead of  forcing everyone     to use     a  lower-bandwidth,
  301. reduced-quality    audio encoding,     a ______ is  placed near the  low-bandwidth
  302. area.  This bridge resynchronizes incoming audio packets to reconstruct     the
  303. constant 20 ms spacing    generated by the  sender, mixes    these  reconstructed
  304. audio streams, translates the  audio encoding to  a lower-bandwidth one     and
  305. forwards the lower-bandwidth packet stream to the low-bandwidth    sites.
  306.  
  307. After the mixing, the identity of  the high-speed site that is speaking     can
  308. no longer be determined    from the network  origin of the    packet.      Therefore,
  309. the bridge inserts a CSRC option (Section 5.2.1) into the packet  containing
  310. a list of short    site  identifiers to indicate which site(s)  ``contributed''
  311. to that    mixed packet.  An example of this is shown for bridge B1 in  Fig. 1.
  312. As name    and location information is  received by the bridge in SDES  options
  313. from the high-speed sites,  that information is    passed    on to the  receivers
  314. along with a mapping to    the CSRC identifiers.
  315.  
  316.  
  317.  
  318.       [E1]                      [E6]
  319.        |                       |
  320.  E1:17 |                 E6:15 |
  321.        |                       |   E6:63/6
  322.        V   B1:48 (1,2)           B1:28/1 (1,2)   V   B1:63/5 (1,2)
  323.       (B1)-------------><T1>-----------------><T2>--------------->[E7]
  324.        ^         ^     E4:28/2           ^   E4:63/3
  325.   E2:1 |       E4:47 |               |   B3:63/4 (1,4)
  326.        |         |               |
  327.       [E2]        [E4]               |
  328.                            |        LEGEND:
  329. [E3] --------->(B2)----------->(B3)------------|      [End system]
  330.        E3:64        B2:12 (3)    ^              (Bridge)
  331.                 | E5:45              <Translator>
  332.                 |
  333.                    [E5]    content: source    port/SSRC (CSRCs)
  334.                     -------------------------------->
  335.   Figure 1:  Sample RTP    network    with end systems, bridges and translators
  336.  
  337.  
  338.  
  339. 2.3 Translators
  340.  
  341.  
  342. Not all     sites are  directly accessible     through IP  multicast.      For  these
  343. sites, mixing  may  not     necessary,  but a  translation     of  the  underlying
  344. transport protocol is.     RTP-level  gateways that do  not restore timing  or
  345.  
  346. H. Schulzrinne/S. Casner          Expires 11/01/93            [Page 6]
  347.  
  348.  
  349. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  350.  
  351. mix packets from different sources are called ___________ in this  document.
  352. Application-level firewalls, for example, will not let any IP packets  pass.
  353. Two translators     are installed,     one on     either    side  of the  firewall,     the
  354. outside    one  funneling all  multicast packets  received    through     the  secure
  355. connection to the  translator inside the  firewall.   The translator  inside
  356. the firewall sends  them again    as multicast  packets to  a multicast  group
  357. restricted to  the site's  internal network.    Other examples    include     the
  358. connection of a    group of hosts speaking    only IP/UDP to a group of hosts    that
  359. understand only    ST-II.
  360.  
  361. After RTP  packets have     passed    through     a translator,    they all  carry     the
  362. network    source    address    of  the    translator,  making  it    impossible  for     the
  363. receiver to distinguish     packets from  different speakers  based on  network
  364. source addresses.    Since each     sending site  has its    own sequence  number
  365. space and slightly offset timestamp  space, the    receiver could not  properly
  366. mix the    audio  packets.      (For video,  it could    not  properly separate    them
  367. into distinct displays.)   Instead  of forcing all  senders to include    some
  368. globally unique    identifier  in each  packet,  a    translator  inserts an    SSRC
  369. option (Section     5.2.2)    with  a     short identifier  for    the source  that  is
  370. locally    unique to the translator.  This     also works if an RTP packet has  to
  371. travel through several translators, with the SSRC value    being mapped into  a
  372. new locally unique value at each translator.  An example is shown in Fig. 1,
  373. where hosts T1 and  T2 are translators.      The RTP packets  from    host E4     are
  374. identified with    SSRC value 2, while those coming from bridge B1    are  labeled
  375. with SSRC value    1.  Similarly, translator T2 labels packets from E6, B1,  E4
  376. and B3 with SSRC values     6, 5, 3 and 4,     respectively (or some other  unique
  377. values).
  378.  
  379.  
  380.  
  381. 2.4 Security
  382.  
  383.  
  384. Conference participants     would often  like to  ensure that  nobody else     can
  385. listen to their    deliberations.    Encryption, indicated by the presence of the
  386. ENC option (Section 5.4.1),  provides that privacy.   The encryption  method
  387. and key    can be changed during the conference by    indexing into a    table.     For
  388. example, a meeting may go into    executive session, protected by    a  different
  389. encryption key accessible only to a subset of the meeting participants.
  390.  
  391. For authentication, a number of    methods    are provided, depending    on needs and
  392. computational capabilities.  All these message integrity check (MIC) options
  393. (Sections 5.4.3    and following)    compute    cryptographic checksums, also  known
  394. as message digests, over the RTP data.
  395.  
  396.  
  397. 3 Definitions
  398.  
  399.  
  400. _______    is the data following the RTP fixed header and the RTP/RTCP options.
  401. The payload format  and    interpretation are  beyond the scope  of this  memo.
  402.  
  403.  
  404. H. Schulzrinne/S. Casner          Expires 11/01/93            [Page 7]
  405.  
  406.  
  407. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  408.  
  409. RTP packets without payload  are valid.      Examples of payload include  audio
  410. samples    and video data.
  411.  
  412. An ___    ______    consists  of  the encapsulation     specific  to  a  particular
  413. underlying protocol, the fixed RTP header, RTP and RTCP    options    (if any) and
  414. the payload, if    any.  A    single packet of the underlying    protocol may contain
  415. several    RTP packets if permitted by the    encapsulation method.
  416.  
  417. A __________  ____ is  the  ``abstraction that    transport protocols  use  to
  418. distinguish among  multiple  destinations  within  a  given  host  computer.
  419. TCP/IP protocols identify  ports using    small positive    integers.'' [1]     The
  420. transport selectors (TSEL) used    by the OSI transport layer are equivalent to
  421. ports.
  422.  
  423. A _________ _______ denotes  the combination of     network address, e.g.,     the
  424. 4-octet    IP Version 4 address, and the transport    protocol port, e.g., the UDP
  425. port.  In  OSI systems,     the transport address    is called transport  service
  426. access point or    TSAP. The destination transport    address    may be a unicast  or
  427. multicast address.
  428.  
  429. A _______  ______  is the  actual  source of  the  data    carried     in  an     RTP
  430. packet,    for example,  the application that  originally generated some  audio
  431. data.  Data from one or    more  content sources may be combined into a  single
  432. RTP packet by a    bridge,    which  becomes the synchronization source (see    next
  433. paragraph).  Content  sources identify the logical  source of the data,     for
  434. example, to highlight the current speaker in an    audio conference; they    have
  435. no effect on the delivery or playout timing of the data    itself.     In  Fig. 1,
  436. E1 and E2 are the content sources of the data received by E7 from bridge B1,
  437. while B1 is the    synchronization    source.
  438.  
  439. A _______________ ______ is the    combination  of    one or more content  sources
  440. with its  own timing.     Each synchronization  source has  its own  sequence
  441. number space.    The  audio coming  from    a  single microphone  and the  video
  442. from a    camera    are examples  of  synchronization  sources.    The  receiver
  443. groups packets by synchronization source for  playback.     Typically a  single
  444. synchronization    source emits  a    single    medium (e.g.,  audio or    video).       A
  445. synchronization    source may  change its    data format,  e.g., audio  encoding,
  446. over time.    Synchronization  sources    are identified    by  their  transport
  447. address    and the    identifier carried in the  SSRC    option.     If the    SSRC  option
  448. is absent, a value of zero is assumed for that identifier.
  449.  
  450. A _________ ______ is the transport-level origin of the    RTP packets as    seen
  451. by the receiving end system.  In  Fig. 1, host T2, port    63 is the  transport
  452. source of all packets received by end system E7.
  453.  
  454. A  _______  comprises  all  synchronization  sources  sending  to  the    same
  455. destination transport address using the    same RTP channel identifier.
  456.  
  457. An ___ ______ generates    the content to    be sent    in RTP packets and  consumes
  458. the content  of     received  RTP.     An  end system     can  act  as  one  or    more
  459. synchronization    sources.   (Most  end systems are  expected to    be a  single
  460.  
  461.  
  462. H. Schulzrinne/S. Casner          Expires 11/01/93            [Page 8]
  463.  
  464.  
  465. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  466.  
  467. synchronization    source.)
  468.  
  469. An (RTP-level)    ______    receives  RTP  packets from  one  or  more  sources,
  470. combines them in some manner and then forwards    a new RTP packet.  A  bridge
  471. may change the data format.   Since the    timing among multiple input  sources
  472. will not generally be synchronized, the    bridge will make timing     adjustments
  473. among the  streams and    generate its  own timing  for the  combined  stream.
  474. Therefore, bridges are    synchronization    sources,  with each  of    the  sources
  475. whose packets  were combined  into an  outgoing    RTP  packet as    the  content
  476. sources    for that outgoing  packet.  Audio  bridges and media converters     are
  477. examples of bridges.  In Fig. 1,  end systems E1 and E2    use the    services  of
  478. bridge B1.  B1 inserts CSRC identifiers     for E1    and E2 when they are  active
  479. (e.g., talking in an audio conference).     The RTP-level bridges described  in
  480. this document are unrelated  to    the data link-layer  bridges found in  local
  481. area networks.    If there  is possibility for confusion,    the term  'RTP-level
  482. bridge'    should be used.      The name  bridge follows common  telecommunication
  483. industry usage.
  484.  
  485. An (RTP-level) __________  forwards RTP    packets,  but does  not    alter  their
  486. sequence numbers  or timestamps.    Examples  of  its use  include  encoding
  487. conversion without mixing or retiming, conversion from multicast to unicast,
  488. and application-level  filters in  firewalls.    A  translator is  neither  a
  489. synchronization    nor  a    content    source.        The    properties  of    bridges     and
  490. translators are    summarized in Table 1.    Checkmarks in parentheses  designate
  491. possible, but unlikely actions.     The options are explained in Sections    5.2,
  492. the RTCP options in Section 6.
  493.  
  494.  
  495.  
  496.                     end    sys.  bridge  translator
  497.        mix sources               --     x      --
  498.        change encoding           N/A     x      x
  499.        encrypt            x     x     (x)
  500.        sign    for authentication    x     x      --
  501.        alter content        x     x      x
  502.        insert CSRC (RTP)           --     x      --
  503.        insert SSRC (RTP)        x     x      x
  504.        insert SDST (RTP)        x     x      --
  505.        insert SDES (RTCP)        x     x      --
  506.  
  507.  
  508.       Table 1:    The properties of end systems, bridges and translators
  509.  
  510. A _______________ ____    consists of  one or  more packets  that    are  emitted
  511. contiguously by     the sender.    The most  common synchronization  units     are
  512. talkspurts for voice  and frames  for video  transmission.   During  playout
  513. synchronization, the receiver must  reconstruct    exactly    the time  difference
  514. between    packets    within a synchronization unit.    The time difference  between
  515. synchronization    units may be changed by    the receiver to    compensate for clock
  516. drift or to adjust to changing network delay jitter.  For example, if  audio
  517. packets    are generated  at fixed     intervals during  talkspurts, the  receiver
  518. has to play back packets  with exactly the same    spacing.   However, if,     for
  519.  
  520. H. Schulzrinne/S. Casner          Expires 11/01/93            [Page 9]
  521.  
  522.  
  523. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  524.  
  525. example, a silence period  between synchronization units (talkspurts)  lasts
  526. 600 ms,     the receiver  may adjust  it to,  say,     500 ms     without this  being
  527. noticed    by the listener.
  528.  
  529. _______    __________  refers to  other protocols    and mechanisms    that may  be
  530. needed to  provide  a  useable    service.    In    particular,  for  multimedia
  531. conferences, a conference control application may distribute encryption     and
  532. authentication keys,  negotiate    the  encryption    algorithm  to be  used,     and
  533. determine the mapping from  the    RTP format field  to the actual    data  format
  534. used.  For simple applications,    electronic mail    or a conference    database may
  535. also be    used.  The specification of such mechanisms is outside the scope  of
  536. this memorandum.
  537.  
  538.  
  539.  
  540. 4 Byte Order, Alignment, and Reserved Values
  541.  
  542.  
  543. All integer  fields  are  carried in  network  byte  order,  that  is,    most
  544. significant byte  (octet) first.    This  byte order  is commonly  known  as
  545. big-endian.  The transmission order is described in detail in [2],  Appendix
  546. A. Unless  otherwise noted,  numeric  constants    are  in    decimal     (base    10).
  547. Numeric    constants prefixed by '0x' are in hexadecimal.
  548.  
  549. Fields within the fixed    header and within options are aligned to the natural
  550. length of  the field,  i.e., 16-bit  words are    aligned     on even  addresses,
  551. 32-bit long words are aligned at addresses  divisible by four, etc.   Octets
  552. designated as padding have the value zero.
  553.  
  554. Textual    information is    encoded    accorded to  the UTF-2 encoding     of the     ISO
  555. standard 10646 (Annex F) [3,4].     US-ASCII  is a    subset of this encoding    and
  556. requires no additional encoding.   The presence    of multi-octet encodings  is
  557. indicated by setting the most significant bit to  a value of one.  An  octet
  558. with a binary value of zero may     be used as a string terminator    for  padding
  559. purposes.  However, strings are    not required to    be zero    terminated.
  560.  
  561.  
  562. 5 Real-Time Data Transfer Protocol -- RTP
  563.  
  564.  
  565.  
  566. 5.1 RTP    Fixed Header Fields
  567.  
  568.  
  569. The RTP    header has the following format:
  570.  
  571.  
  572.  0             1             2             3
  573.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  574. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  575. |Ver| ChannelID    |P|S|  format    |    sequence number        |
  576. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  577.  
  578. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 10]
  579.  
  580.  
  581. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  582.  
  583. |     timestamp    (seconds)    |     timestamp    (fraction)    |
  584. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  585. | options ...                            |
  586. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  587.  
  588.  
  589. The first  eight  octets  are present  in  every  RTP packet  and  have     the
  590. following meaning:
  591.  
  592.  
  593. protocol version: 2 bits
  594.     Identifies the  protocol version.    The version  number of the  protocol
  595.     defined in this memo is one    (1).
  596.  
  597. channel    ID: 6 bits
  598.     The    channel     identifier  field forms  part of  the tuple  identifying  a
  599.     channel (see definition in Section 3) to provide an    additional  level of
  600.     multiplexing at  the RTP  layer.   The  channel ID    field is  convenient
  601.     if several    different  channels are     to receive  the same  treatment  by
  602.     the    underlying layers  or if a profile  allows for the concatenation  of
  603.     several RTP    packets     on different channels into  a single packet of     the
  604.     underlying protocol    layer.
  605.  
  606. option present bit (P):    1 bit
  607.     This flag has a value of one (1) if    the fixed RTP header is     followed by
  608.     one    or more    options    and a value of zero otherwise.
  609.  
  610. end-of-synchronization-unit (S): 1 bit
  611.     This flag has  a value of  one in the last    packet of a  synchronization
  612.     unit, a value of  zero otherwise.[As shown in Appendix A, the  beginning
  613.     of a  synchronization unit can  be readily established  from this  flag.
  614.     If this  flag were    to signal the  beginning of  a synchronization    unit
  615.     instead, the end of     a synchronization unit    could not be established  in
  616.     real time.]
  617.  
  618. format:    6 bits
  619.     The     format    field  forms  an index    into  a    table  defined    through     the
  620.     RTCP  FMT  option  or   non-RTP  mechanisms     (see  Section    3).     The
  621.     mapping establishes     the format of    the RTP    payload     and determines     its
  622.     interpretation by  higher layers.    If  no mapping has  been defined  in
  623.     this manner,  a standard mapping is     specified by the companion  profile
  624.     document, RFC TBD. Also,  default formats may be defined by    the  current
  625.     edition of the Assigned Numbers RFC.
  626.  
  627. sequence number: 16 bits
  628.     The    sequence number    counts RTP packets.  The sequence  number increments
  629.     by one  for     each packet  sent.   The  sequence number  may    be  used  by
  630.     the    receiver to  detect packet loss, to  restore packet sequence and  to
  631.     identify packets to    the application.
  632.  
  633. timestamp: 32 bits
  634.  
  635.  
  636. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 11]
  637.  
  638.  
  639. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  640.  
  641.     The    timestamp  reflects the     wall clock  time  when    the  RTP packet     was
  642.     generated.     Several consecutive RTP  packets may have equal  timestamps
  643.     if they are    generated at once.  The    timestamp consists of the  middle 32
  644.     bits of a 64-bit  NTP timestamp, as    defined    in  RFC    1305 [5].  That     is,
  645.     it counts  time since 0 hours  UTC,    January    1,  1900, with a  resolution
  646.     of    65536  ticks per  second.    (UTC  is  Coordinated  Universal  Time,
  647.     approximately equal     to the    historical  Greenwich Mean Time.)   The     RTP
  648.     timestamp wraps around approximately every 18 hours.
  649.  
  650.     The    timestamp  of  the first  packet within     a synchronization  unit  is
  651.     expected  to  closely reflect  the    actual    sampling  instant,  measured
  652.     by    the local  system  clock.    If     possible, the    local  system  clock
  653.     should be  controlled by a    time synchronization protocol  such as    NTP.
  654.     However,  it  is  allowable    to  operate  without  synchronized  time  on
  655.     those systems  where it is    not available, unless  a profile or  session
  656.     protocol requires  otherwise.   It    is  not    necessary  to reference     the
  657.     local  system  clock  to obtain  the  timestamp  for  the  beginning  of
  658.     every synchronization  unit, but  the local    clock  should be  referenced
  659.     frequently enough  so that clock drift  between the    synchronized  system
  660.     clock and the sampling clock  can be compensated for gradually.   Within
  661.     one    synchronization     unit, it may be  appropriate to compute  timestamps
  662.     based on  the logical  timing relationships    between     the packets.     For
  663.     audio samples, for example,    the nominal sampling interval may be used.
  664.  
  665.  
  666.  
  667. 5.2 The    RTP Options
  668.  
  669.  
  670. The packet  header  may     be  followed  by  options  and     then  the  payload.
  671. Each option consists  of the  F    (final)     bit, the  option type    designation,
  672. a  one-octet  length  field  denoting  the  total  number  of  32-bit  words
  673. comprising the option (including  F bit, type and  length), followed by     any
  674. option-specific    data.  The last    option before the payload has the F bit     set
  675. to one;    for all    other options this bit has a value of zero.
  676.  
  677. An application    may discard  options with  types  unknown to  it.    Private
  678. and experimental options  should use option  types 64 through  127.   Fields
  679. designated as  ``reserved'' or    ``R'' are  set aside  for future  use;    they
  680. should be set to zero by senders and ignored by    receivers.
  681.  
  682. Unless otherwise noted,    each option may    appear    only once per packet.    Each
  683. packet may contain any number of options.  Options may appear in any  order,
  684. unless specifically restricted by  the option description.   In     particular,
  685. the position of    some security options may have significance.
  686.  
  687. The RTP    options    have the following type    values:
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 12]
  695.  
  696.  
  697. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  698.  
  699. name  value
  700. CSRC      0
  701. SSRC      1
  702. SDST      2
  703. BOS      3
  704. ENC      8
  705. MIC      9
  706. MICA     10
  707. MICK     11
  708. MICS     12
  709.  
  710.  
  711.  
  712. 5.2.1 CSRC: Content source identifiers
  713.  
  714.  
  715.  0             1             2             3
  716.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  717. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  718. |F|    CSRC    |    length    | content source identifier    ...
  719. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  720.  
  721. The content source option, inserted only by bridges, lists all sources    that
  722. contributed to the packet.  For    example, for audio packets, all    sources    that
  723. were mixed together to create  this packet are enumerated, allowing  correct
  724. talker indication at the receiver.  Each CSRC option may contain one or    more
  725. 16-bit content source identifiers.  The    identifier values must be unique for
  726. all content sources received from  a particular    synchronization    source on  a
  727. particular channel;  the value of  binary zero    is reserved and     may not  be
  728. used.  If the  number of content sources is  even, the two octets needed  to
  729. pad the    list to     a multiple of four  octets are    set to    zero.  There  should
  730. only be    a single CSRC option within a packet.  If no CSRC option is present,
  731. the content source  identifier is assumed  to have a  value of zero.    CSRC
  732. options    are not    modified by RTP-level translators.
  733.  
  734. A conformant RTP  implementation does  not have    to  be able  to    generate  or
  735. interpret the CSRC option.
  736.  
  737.  
  738.  
  739. 5.2.2 SSRC: Synchronization source identifier
  740.  
  741.  
  742.  0             1             2             3
  743.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  744. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  745. |F|    SSRC    |  length = 1    |       identifier        |
  746. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  747.  
  748. The SSRC option    may  be    inserted by RTP-level  translators, end    systems     and
  749. bridges.   It is  typically used only  by translators,    but it    may be    used
  750. by an end system  application to distinguish several  sources sent with     the
  751.  
  752. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 13]
  753.  
  754.  
  755. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  756.  
  757. same transport source address.     Multiple  synchronization sources with     the
  758. same transport    source address    (e.g., the  same IP  address and  UDP  port)
  759. must each insert a  distinct SSRC identifier.    Conversely,  synchronization
  760. sources    that are distinguishable by  their transport address do    not  require
  761. the use    of  SSRC options.   The    SSRC  value zero is  reserved; the  receiver
  762. treats the packet  as if  the SSRC  option were     not present.     If no    SSRC
  763. option is present, the transport source     address is assumed to indicate     the
  764. synchronization    source.      There    must  be no  more than one  SSRC option     per
  765. packet;    thus, a     translator must remap    the SSRC  identifier of    an  incoming
  766. packet into a new, locally unique SSRC    identifier.  The SSRC option can  be
  767. viewed as an  extension    of  the    source port  number in    protocols like    UDP,
  768. ST-II or TCP.
  769.  
  770. An RTP receiver     must support the  SSRC    option.      RTP senders  only need  to
  771. support    this option if they intend to send more    than one source    to the    same
  772. channel    using the same source port.
  773.  
  774.  
  775.  
  776. 5.2.3 BOS: Beginning of    synchronization    unit
  777.  
  778.  
  779.  0             1             2             3
  780.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  781. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  782. |F|    BOS    |   length = 1    |     sequence number    |
  783. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  784.  
  785. The sequence number within the options    contains the sequence number of     the
  786. first packet within the    current    synchronization    unit.  The BOS option allows
  787. the receiver to    compute    the offset of a    packet with respect to the beginning
  788. of the    synchronization     unit,    even if     the  last packet  of  the  previous
  789. synchronization    unit was lost.     It is expected    that many applications    will
  790. be able    to tolerate such a loss, and so    will not use the BOS option but    rely
  791. on the S bit.
  792.  
  793.  
  794.  
  795.  
  796. 5.3 Reverse-Path Option
  797.  
  798.  
  799. With two-party (unicast)  communications, having  a receiver  of data  relay
  800. back control information to the    sender    is straightforward.  Similarly,     for
  801. multicast communications,  control information    can easily  be sent  to     all
  802. members    of the    group.     It may,  however, be  desirable to  send a  unicast
  803. message    to a  single member  of    a multicast  group, for     example to  request
  804. retransmission of a  particular    data  frame or to  request/send    a  reception
  805. quality    report.      For  this particular    use,  RTP includes  a mechanism     for
  806. sending    so-called reverse RTP packets.    The format of reverse RTP packets is
  807. exactly    the same as  for regular RTP  packets and they can  make use of     all
  808. the options defined in    this memorandum, except    SSRC,  as appropriate.     The
  809.  
  810. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 14]
  811.  
  812.  
  813. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  814.  
  815. support    for and     semantics of particular  options are to  be specified by  a
  816. profile.  Reverse RTP packets travel through the same translators as forward
  817. RTP packets.   A  site distinguishes reverse  RTP packets  from    forward     RTP
  818. packets    by their  arrival port.       Reverse RTP    packets    arrive    on the    same
  819. port that the site  uses as a  source port for    forward    (data) RTP  packets.
  820. Only reverse RTP packets carry the SDST     option; if RTP    packets    are  carried
  821. directly within    IP  or other network-layer  protocols, the  presence of     the
  822. SDST option signals that the packet is a reverse RTP packet.
  823.  
  824. A receiver of  reverse RTP  packets cannot  rely on  sequence numbers  being
  825. consecutive, as    a sender  is allowed to    use  the same sequence number  space
  826. while communicating  through this  reverse  path with  several    sites.      In
  827. particular, a receiver of  reverse RTP packets cannot  tell by the  sequence
  828. numbers    whether    it has    received all reverse  RTP packets sent to  it.     The
  829. sequence number    space of reverse RTP  packets has to be    completely  separate
  830. from that  used    for  RTP  packets sent    to  the    multicast  group.    If     the
  831. same sequence number  space were used,    the members of    the multicast  group
  832. not receiving  reverse RTP  packets would  detect a  gap in  their  received
  833. sequence number    space.      The sender of     reverse RTP  packets should  ensure
  834. that sequence numbers  are unique,  modulo  wrap-around, so  that they    can,
  835. if necessary,  be  used    for  matching request  and  response.     (Currently,
  836. no such    request-response  mechanism has    been  defined.)      As a    hypothetical
  837. example, consider  defining  a    request     to pan     the  remote  video  camera.
  838. After completing  the request,    the receiver  of the  request would  send  a
  839. generic    acknowledgement    containing  the    sequence  number of  the request  to
  840. the requestor as an option (not    as  the    packet sequence    number in the  fixed
  841. header).
  842.  
  843. The timestamp should  reflect the  approximate sending time  of    the  packet.
  844. The channel identifier must  be    the same as  that used in the  corresponding
  845. forward    RTP packets.
  846.  
  847. If many    receivers send    a reverse RTP  packet in response  to a    stimulus  in
  848. the data stream,  the simultaneous  delivery of     a large  number of  packets
  849. back to    the data source     can cause congestion for  both    the network and     the
  850. destination (this  is known  as    an  ``ack implosion'').       Thus    reverse     RTP
  851. packets    should be used with care,  perhaps with    mechanisms such    as  response
  852. rate limiting and random delays    to spread out the simultaneous delivery.
  853.  
  854.  
  855. 5.3.1 SDST: Synchronization destination    identifier
  856.  
  857.  
  858.  0             1             2             3
  859.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  860. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  861. |F|    SDST    |   length = 1    |        identifier        |
  862. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  863.  
  864. The SDST option    is only    inserted by RTP    end systems and    bridges    if they    want
  865. to send    unicast    information to a particular site within    the multicast group.
  866.  
  867.  
  868. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 15]
  869.  
  870.  
  871. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  872.  
  873. Packets    containing an SDST option must    not contain an SSRC option and    vice
  874. versa.     Packets containing a  SDST option are    always reverse RTP  packets.
  875. The SDST option    may be used to distinguish reverse RTP packets from  forward
  876. RTP packets if the port-number    mechanism described earlier in this  section
  877. is not available, e.g.,    because    RTP  packets are carried directly within  IP
  878. packets, without UDP.
  879.  
  880. If a  forward RTP  packet carries  SSRC    identifier  X when  sent from  A  to
  881. B, where A  and    B  may be  either two  translators or  an end  system and  a
  882. translator, the    unicast    reverse     RTP packet will carry    an SDST    option    with
  883. identifier X from B to A.
  884.  
  885. Consider the topology shown in Fig. 1.    Assume that all    forward    RTP  packets
  886. are addressed to destination port 8000.     For the case that B1 wants  to    send
  887. a reverse packet to E1,    B1 simply sends    to the source address and port,    that
  888. is, port 17 in this example.  E1 can tell by the arrival on port 17 that the
  889. packet is a reverse packet rather than a regular (forward) packet.
  890.  
  891. The mechanism is somewhat more complicated  when translators intervene.      We
  892. focus on end system E7.      E7 receives, say,  video from    a range    of  sources,
  893. E1 through E6  as indicated  by    the  arrows.   The transmission     from T2  to
  894. E7 could be either  multicast or unicast.   Assume that    E7  wants to send  a
  895. retransmission request,    a request to pan the camera, etc., to end system  E4
  896. and only to E4.     E7 may    not be able to directly    reach E4, as E4    may be using
  897. a network protocol unknown to E7 or be located behind a    firewall.  According
  898. to the figure, video transmissions from     E4 reach E7 through T2    with  source
  899. port 63    and SSRC identifier 3.    For the    reverse    message, E7 sends  a message
  900. to T2, with destination    port 63     and SDST identifier 3.      T2 can look up  in
  901. its table that    it sends forward  data coming from  T1 with that  identifier
  902. 3.   T2    also  knows that  those    messages  from T1  carry SSRC  2 and  arrive
  903. with source port 28.   Just  like E7,  T2 places the  SSRC identifier, 2  in
  904. this case, into    the SDST  option and forwards the packet  to T1    at port     28.
  905. Finally, translator T1    consults its table  to find that  it labels  packets
  906. coming from E4,     port 47 with  SSRC value 2  and thus  knows to    forward     the
  907. reverse    packet to E4, port 47.     T1 can    either    place SDST value zero or  no
  908. SDST option into that packet.    Note that E4 cannot directly determine    that
  909. E7 sent    the reverse packet, rather than, say,  E6.  If that is important,  a
  910. global identifier as defined for the QOS option    needs to be included in     the
  911. reverse    packet.
  912.  
  913. Only applications that need to send  or    receive    reverse    control    RTP  packets
  914. need to    implement the SDST option.
  915.  
  916.  
  917.  
  918.  
  919. 5.4 Security Options
  920.  
  921.  
  922. The security  options  below offer  message  integrity,     authentication     and
  923. privacy    and  the  combination  of the  three.     Support  for  the  security
  924. options    is not mandatory, but  see the discussion for the  ENC option.     The
  925.  
  926. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 16]
  927.  
  928.  
  929. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  930.  
  931. four message integrity check  options --- MIC, MICA,  MICK and MICS ---     are
  932. mutually exclusive, i.e., only    one of them should be  used in a single     RTP
  933. packet.
  934.  
  935. Combinations of    one of the message integrity check options (MIC, MICA, MICK,
  936. or MICS) and  the encryption  (ENC) option described  below can     be used  to
  937. provide    a variety of security services:
  938.  
  939.  
  940.  
  941. confidentiality: Confidentiality  means    that only  the intended     receiver(s)
  942.     can     decode     the received  RTP  packets;  for  others,  the     RTP  packet
  943.     contains no     useful     information.    Confidentiality     of the     content  is
  944.     achieved by    encryption.   The presence of encryption and the  encryption
  945.     initialization vector  is indicated     by the     ENC option.[For  efficiency
  946.     reasons,  this specification  does not  insist that     content  encryption
  947.     only be  used in conjunction with  message integrity and  authentication
  948.     mechanisms.     In most  cases, it will be obvious to the person  receiving
  949.     the    data if    he or she does not possess the right encryption    key.]
  950.  
  951. authentication and message integrity: In  combination with  certificates(2),
  952.     the    receiver  can ascertain    that  the claimed originator  is indeed     the
  953.     originator    of the    data  (authentication) and  that  the data  has     not
  954.     been  altered after     leaving  the sender  (message    integrity).    These
  955.     two     security services  are     provided  by the  message  integrity  check
  956.     options.    Certificates  for MICA    must  be distributed  through  means
  957.     outside of RTP. The     services offered by MICA and MIC/MICK/MICS  differ:
  958.     With  MIC/MICK/MICS, the  receiver    can  only verify  that    the  message
  959.     originated    within    the  group  holding  the  secret key,    rather    than
  960.     authenticate the sender  of    the message,  while the    MICA option  affords
  961.     true authentication    of the sender.
  962.  
  963. authentication,    message    integrity, and confidentiality:    By   carrying    both
  964.     the     message  integrity  check  and     ENC  option  in RTP  packets,     the
  965.     authenticity, message  integrity and confidentiality  of the packet     can
  966.     be    assured     (subject to  the  limitations    discussed  in  the  previous
  967.     paragraph).
  968.  
  969.     The     message integrity  check  is applied  first  to all  parts  of     the
  970.     outgoing packet  to    be  authenticated, and the  message integrity  check
  971.     option is  prepended to  those parts.    Then the  packet including     the
  972.     message integrity  check option  is     encrypted using  the shared  secret
  973.     key.    The    ENC  option  must be  followed    immediately by    the  message
  974.     integrity check  option,  without any  other options  in between.     The
  975.     receiver first  decrypts the octets     following the ENC  option and    then
  976.     authenticates the  decrypted data using the     signature contained in     the
  977.     message integrity check option.
  978.  
  979.     For    this combination of security features and group    authentication,     the
  980. ------------------------------
  981.  2. For    a description of certificates see, for example,    RFC 1422 or [6].
  982.  
  983.  
  984. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 17]
  985.  
  986.  
  987. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  988.  
  989.     combination    ENC and    MIC is recommended (instead of MICS or MICK),  as it
  990.     yields the lowest processing overhead.
  991.  
  992.  
  993.  
  994. A message integrity  check option followed  by an ENC  option should not  be
  995. used.    All  message integrity    check options  are computed  over the  fixed
  996. header,    the first four octets of the message integrity check option and     the
  997. data, that is,    the remaining  header options  and payload  that follow     the
  998. message    integrity check     option.   The MICK option  includes the whole    MICK
  999. option itself in the message integrity check.  The fixed header    is protected
  1000. to foil    replay attacks and reassignment    to a different channel.
  1001.  
  1002. The message  integrity check  options and  the ENC  option shall  not  cover
  1003. the SSRC and  SDST options,  i.e., SSRC     and SDST must    be inserted  between
  1004. the fixed header and the  ENC or message integrity  check options; SSRC     and
  1005. SDST are subject  to change by    translators that likely     do not    possess     the
  1006. necessary descriptor table  (see below)     and encryption    keys.     Translators
  1007. that have the  necessary keys  and descriptor translation  table may  modify
  1008. the contents of    the  RTP packet, unless     the MICA option  is used (see    MICA
  1009. description in Section 5.4.3).
  1010.  
  1011. All security options carry  a one-octet    descriptor field.   This  descriptor
  1012. is an index into  two tables, one for  the message integrity check  options,
  1013. one for    the  ENC option,  established  by non-RTP means,  containing  digest
  1014. algorithms (MD2,  MD5,    etc.),    encryption  algorithms    (DES  variants)     and
  1015. encryption keys     or shared  secrets (for  the  MICK option).    All  sources
  1016. within the same    channel     share the same    table;    this reduces per-site  state
  1017. information.  The descriptor value may change during a session,    for example,
  1018. to switch to a different encryption key.
  1019.  
  1020. The descriptor value zero selects a  set of default algorithms,    namely,     MD5
  1021. for the    message    digest algorithm, DES CBC for the encryption algorithm.
  1022.  
  1023.  
  1024. 5.4.1 ENC: Encryption
  1025.  
  1026.  
  1027.  0             1             2             3
  1028.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1029. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1030. |F|    ENC    |   length = 3    |    reserved    |   descriptor    |
  1031. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1032. |      DES (CBC) initialization    vector,    bytes 0    through    3    |
  1033. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1034. |      DES (CBC) initialization    vector,    bytes 4    through    7    |
  1035. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1036.  
  1037. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1038. |F|    ENC    |   length = 1    |    reserved    |   descriptor    |
  1039. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1040.  
  1041.  
  1042. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 18]
  1043.  
  1044.  
  1045. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1046.  
  1047. All packet data    after this option is encrypted,    using the encryption key and
  1048. symmetric encryption algorithm    specified by  the descriptor field.    Every
  1049. encrypted RTP packet must contain this option.     Note that the fixed  header
  1050. is specifically    not  encrypted because    some fields must  be interpreted  by
  1051. translators that will not have access to the key.  The descriptor value     may
  1052. change over time to accommodate     varying security requirements or limit     the
  1053. amount of ciphertext using the    same key.  For    example, in a job  interview
  1054. conducted across a network, the     candidate and interviewers could share     one
  1055. key, with a second key set aside  for the interviewers only.  For  symmetric
  1056. keys, source-specific keys offer no advantage.
  1057.  
  1058. The descriptor value  zero is  reserved    for a  default mode  using the    Data
  1059. Encryption Standard (DES)  algorithm in     CBC (cipher  block chaining)  mode,
  1060. as described  in  Section 1.1  of  RFC 1423  [7].    The  padding  specified
  1061. in that    section     is to    be used.    The    8-octet     initialization    vector    (IV)
  1062. may be carried unencrypted  within the ENC option,  generated anew for    each
  1063. packet.       If the  ENC    option does  not  contain an  initialization  vector
  1064. (indicated by an option    length of one),    the fixed RTP header is    used as     the
  1065. initalization vector.    (Using the  fixed RTP header  as the  initialization
  1066. vector avoids regenerating  the    initialization    vector for  each packet     and
  1067. incurs less  header  overhead.)       For    details     on the     tradeoffs  for     CBC
  1068. initialization vector use, see [8].  Support for encryption is not required.
  1069. Implementations    that  do not  support encryption  should recognize  the     ENC
  1070. option so  that    they  can avoid     processing encrypted  messages    and  provide
  1071. a meaningful failure  indication.   Implementations that support  encryption
  1072. should,    at the minimum,    always support the DES CBC algorithm.
  1073.  
  1074.  
  1075.  
  1076. 5.4.2 MIC: Messsage integrity check
  1077.  
  1078.  
  1079.  0             1             2             3
  1080.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1081. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1082. |F|    MIC    |     length    |    reserved    |   descriptor    |
  1083. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1084. |          message digest (unencrypted)               ...
  1085. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1086.  
  1087.  
  1088. The  MIC  option  option   is  used  only  in    combination  with  the     ENC
  1089. option immediately  preceding it  to provide  privacy and  group  membership
  1090. authentication.      The  message    integrity check     uses the  digest  algorithm
  1091. specified by the  descriptor field.   (A message  digest is a  cryptographic
  1092. hash function that  transforms a  message of  any length  to a    fixed-length
  1093. byte string,  where the     fixed-length string  has the  property    that  it  is
  1094. computationally    infeasible to generate    another, different message with     the
  1095. same digest.)    The value zero    implies    the use    of  the    MD5 message  digest.
  1096. Note that the MIC option is not    separately encrypted.
  1097.  
  1098.  
  1099.  
  1100. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 19]
  1101.  
  1102.  
  1103. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1104.  
  1105. 5.4.3 MICA: Message integrity check, asymmetric    encryption
  1106.  
  1107.  
  1108.  0             1             2             3
  1109.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1110. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1111. |F|    MICA    |    length    |      message digest       ...
  1112. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1113. |             (asymmetrically encrypted)               ...
  1114. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1115.  
  1116. Currently, only    the  use of  the MD2  and MD5 message  digest algorithms  is
  1117. defined, as described in RFC  1319 [9] (as corrected  in Section 2.1 of     RFC
  1118. 1423) and RFC 1321 [10], respectively.    The MD2    and MD5    message    digests     are
  1119. 16 octets long.
  1120.  
  1121. RFC 1423, Section 2.1:
  1122.  
  1123.  
  1124.  
  1125.     To    avoid any  potential ambiguity    regarding the  ordering     of the
  1126.     octets of  an MD2  message    digest that  is    input  as a  data value
  1127.     to another encryption process  (e.g., RSAEncryption), the following
  1128.     holds true.      The first  (or left-most displayed, if  one thinks in
  1129.     terms of a    digest's ``print'' representation) octet  of the digest
  1130.     (i.e.,  digest[0] as  specified in    RFC 1319),  when  considered as
  1131.     an RSA  data value,     has  numerical    weight    2**120.      The  last (or
  1132.     right-most displayed) octet     (i.e.,    digest[15] as  specified in RFC
  1133.     1319) has numerical    weight 2**0.
  1134.  
  1135.  
  1136. RFC 1423, Section 2.2:
  1137.  
  1138.  
  1139.     To    avoid any  potential ambiguity    regarding the  ordering     of the
  1140.     octets of an MD5 message digest that  is input as an RSA data value
  1141.     to the  RSA     encryption process,  the following  holds true.    The
  1142.     first (or left-most    displayed, if one thinks in terms of a digest's
  1143.     ``print'' representation) octet of    the digest (i.e., the low-order
  1144.     octet of  A    as specified  in RFC 1321),  when considered as     an RSA
  1145.     data value,    has  numerical weight 2**120.    The last (or right-most
  1146.     displayed) octet (i.e.,  the high-order octet of D    as specified in
  1147.     RFC    1321) has numerical weight 2**0.
  1148.  
  1149.  
  1150. The message digest is  encrypted, using    asymmetric  keys, with the  sender's
  1151. private    key using the algorithm    described in Section 4.2.1 of RFC 1423:
  1152.  
  1153.  
  1154.  
  1155.     As described in PKCS #1, all quantities input as data values to the
  1156.     RSAEncryption process shall    be properly justified and padded to the
  1157.  
  1158. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 20]
  1159.  
  1160.  
  1161. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1162.  
  1163.     length of the modulus prior    to the encryption process.  In general,
  1164.     an RSAEncryption input  value is formed by    concatenating a    leading
  1165.     NULL octet,    a block    type BT, a padding string PS, a    NULL octet, and
  1166.     the    data quantity D, that is, RSA input value = 0x00, BT, PS, 0x00,
  1167.     D. To  prepare a MIC  for RSAEncryption,  the PKCS #1  ``block type
  1168.     01'' encryption-block  formatting scheme  is employed.    The block
  1169.     type BT is a single    octet containing the value 0x01    and the    padding
  1170.     string PS is one  or more octets (enough octets  to    make the length
  1171.     of the complete RSA    input value equal to the length    of the modulus)
  1172.     each containing the    value 0xFF. The    data quantity D    is comprised of
  1173.     the    MIC and    the MIC    algorithm identifier.
  1174.  
  1175.  
  1176.  
  1177. The encoding is    described  in detail in     RFC 1423.   For encrypting MD2     and
  1178. MD5, the data quantity    D comprises the    16-octet  checksum, preceded by     the
  1179. binary sequences shown here in hexadecimal:   0x30, 0x20, 0x30,    0x0C,  0x06,
  1180. 0x08, 0x2A, 0x86, 0x48,    0x86, 0xF7, 0x0D, 0x02,    0x02, 0x05, 0x00, 0x04,    0x10
  1181. for MD2    and  0x30, 0x20,  0x30,    0x0C, 0x06,  0x08, 0x2A,  0x86,    0x48,  0x86,
  1182. 0xF7, 0x0D, 0x02, 0x05,    0x05, 0x00, 0x04, 0x10 for MD5.
  1183.  
  1184. Contrary to what is  specified in RFC  1423 for    privacy     enhanced mail,     the
  1185. asymmetrically signed  MIC is  carried in  binary,  ___    represented  in     the
  1186. printable encoding of RFC  1421, Section 4.3.2.4.   The    encrypted length  of
  1187. the signature  will be    equal to  the modulus  of the  RSA encryption  used,
  1188. rounded    to the next integral  octet count.  The     modulus and public key     are
  1189. conveyed to the    receivers by non-RTP means.  Asymmetric    keys are used  since
  1190. symmetric keys would not  allow    authentication of  the individual source  in
  1191. the multicast case.
  1192.  
  1193. The signature is  padded as necessary.     The  value of the  padding is    left
  1194. unspecified.  The number of  non-padding bits within the signature is  known
  1195. to the receiver     as being equal     to the    key  length.   The MIC algorithm  is
  1196. identified through the octets prepended    to the actual 16-octet signature.
  1197.  
  1198. A translator is    not  allowed to    modify    the parts of  an RTP packet  covered
  1199. by the MICA option  as the receiver  would have    no  way    of establishing     the
  1200. identity of the    translator  and    thus could not    verify the integrity of     the
  1201. RTP packet.
  1202.  
  1203. Support    for sending or interpreting MICA options is not    required.
  1204.  
  1205.  
  1206.  
  1207. 5.4.4 MICK: Message integrity check, keyed
  1208.  
  1209.  
  1210.  0             1             2             3
  1211.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1212. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1213. |F|    MICS    |    length    |   reserved    |   descriptor    |
  1214. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1215.  
  1216. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 21]
  1217.  
  1218.  
  1219. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1220.  
  1221. |        message digest (symmetrically encrypted)           ...
  1222. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1223.  
  1224. This message  integrity     check option  does  not  require encryption.      In
  1225. addition to  the RTP  packet parts  to    be included  in    the  message  digest
  1226. according to the introduction to this  section,    the shared secret is  placed
  1227. in the MICK option and included    in the message digest.    The shared secret is
  1228. equivalent to the key used  for    the MICS and ENC  options, but is 16  octets
  1229. long, padded if    needed with  binary zeroes.  The  shared secret    in the    MICK
  1230. option is then replaced    by the computed    16-octet message digest.
  1231.  
  1232. The receiver  stores  the  message  digest contained  in  the  MICK  option,
  1233. replaces it with the  shared secret key    and  computes the message digest  in
  1234. the same manner     as the    sender.      If  the RTP packet  has not been  tampered
  1235. with and has originated    with  one of the holders  of the shared    secret,     the
  1236. computed message digest     will agree with  the digest found  on reception  in
  1237. the MICS option.[The message  integrity    check follows  the practice of    SNMP
  1238. Version    2, as described    in RFC 1446, Section 1.5.1.  The MICS option  itself
  1239. is covered by the  digest in order to  detect tampering    with the  descriptor
  1240. field itself.  Using the secret     key in    the signature instead of  encrypting
  1241. the MD5    message    digest avoids the  use of an encryption    algorithm when    only
  1242. authentication is desired.  However,  the security of this approach has     not
  1243. been as    well established as  the authentication    based on encrypting  message
  1244. digests    used in    the MICS, MIC and MICA options.]
  1245.  
  1246.  
  1247.  
  1248. 5.4.5 MICS: Message integrity check, symmetric-key encrypted
  1249.  
  1250.  
  1251.  0             1             2             3
  1252.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1253. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1254. |F|    MICS    |    length    |   reserved    |   descriptor    |
  1255. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1256. |        message digest (symmetrically encrypted)           ...
  1257. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1258.  
  1259. This message integrity check encrypts the message digest using DES ECB    mode
  1260. as described in    RFC 1423, Section 3.1.
  1261.  
  1262.  
  1263.  
  1264.  
  1265. 6 Real Time Control Protocol --- RTCP
  1266.  
  1267.  
  1268. The real-time control protocol (RTCP)  conveys minimal control and  advisory
  1269. information  during  a    session.      It  provides  support  for   ``loosely
  1270. controlled'' sessions,    i.e.,  where participants  enter and  leave  without
  1271. membership control and parameter negotiation.  The services provided by    RTCP
  1272.  
  1273.  
  1274. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 22]
  1275.  
  1276.  
  1277. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1278.  
  1279. services augment RTP,  but an  end system does    not have  to implement    RTCP
  1280. features to participate    in sessions.   There is    one exception to this  rule:
  1281. if an application sends     FMT options,  the receiver has     to decode these  in
  1282. order to properly interpret the    RTP payload.   RTCP does not aim to  provide
  1283. the services of     a session  control protocol and  does not  provide some  of
  1284. the services desirable for  two-party conversations.   If a session  control
  1285. protocol is in use, the    services of RTCP should    not be required.  (As of the
  1286. writing    of this    document, a session  or    conference control protocol has     not
  1287. been specified within the Internet.)
  1288.  
  1289. RTCP options share the    same structure and numbering  space as RTP  options,
  1290. which are  described  in  Section  5.      Unless  otherwise noted,   control
  1291. information is    carried    periodically  as options  within RTP  packets,    with
  1292. or without payload.   RTCP  packets are    sent  to all members  of a  session.
  1293. These packets are part of the same sequence number space as RTP    packets     not
  1294. containing RTCP    options.    The    period should  be varied  randomly to  avoid
  1295. synchronization    of all sources and its mean should increase with the  number
  1296. of participants    in the    session    to limit the  growth of    the overall  network
  1297. and host interrupt load.  The length of    the period determines, for  example,
  1298. how long a receiver joining a session has to wait until    it can identify     the
  1299. source.     A receiver may    remove from its    list of    active sites a site  that it
  1300. has not    been heard from    for a given time-out period; the time-out period may
  1301. depend on the number of    sites  or the observed average interarrival time  of
  1302. RTCP messages.    Note that not every periodic message has to contain all    RTCP
  1303. options; for example, the  EMAIL part within the  SDES option might only  be
  1304. sent every few messages.  RTCP options should also be sent when     information
  1305. carried    in RTCP    options    changes, but  the generation of    RTCP options  should
  1306. be rate-limited.
  1307.  
  1308. The option types are defined below:
  1309.  
  1310.  
  1311.  
  1312. 6.1 FMT: Format    description
  1313.  
  1314.  
  1315.   0              1              2              3
  1316.   0 1 2    3 4 5 6    7 8 9 0    1 2 3 4    5 6 7 8    9 0 1 2    3 4 5 6    7 8 9 0    1
  1317.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1318.  |F|     FMT     |    length     |R|R|    format     |    reserved     |
  1319.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1320.  |              format-dependent data            ...
  1321.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1322.  
  1323.  
  1324. format:    6 bits
  1325.     The    format field  corresponds to the index    value from the format  field
  1326.     in the RTP fixed header, with values ranging from 0    to 63.
  1327.  
  1328. Format-dependent data: variable    length
  1329.     Format-dependent data  may or may  not appear in  a    FMT option.   It  is
  1330.     passed to the next layer and not interpreted by RTP.
  1331.  
  1332. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 23]
  1333.  
  1334.  
  1335. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1336.  
  1337. A FMT mapping changes the interpretation of a given format value carried  in
  1338. the fixed RTP header starting at the packet containing the FMT option.     The
  1339. new interpretation applies  only to  packets from  the same  synchronization
  1340. source as the  packet containing the  FMT option.   If    format mappings     are
  1341. changed    through    the FMT     option, the option should  be sent periodically  as
  1342. otherwise sites    that did not  receive the FMT option  due to packet loss  or
  1343. joining    the session  after the    FMT option  was    sent  will not    know how  to
  1344. interpret the particular format    value.
  1345.  
  1346.  
  1347.  
  1348.  
  1349. 6.2 SDES: Source descriptor
  1350.  
  1351.  
  1352.   0              1              2              3
  1353.   0 1 2    3 4 5 6    7 8 9 0    1 2 3 4    5 6 7 8    9 0 1 2    3 4 5 6    7 8 9 0    1
  1354.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1355.  |F|     SDES     |    length     |     source    identifier     |
  1356.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1357.  
  1358.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1359.  |  type = ADDR     |    length     |    reserved     | address type     |
  1360.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1361.  |               network-layer address            ...
  1362.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1363.  
  1364.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1365.  |  type = ADDR     |   length = 2     |    reserved     | addr. type =    1|
  1366.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1367.  |                IPv4 address             |
  1368.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1369.  
  1370.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1371.  |  type = PORT     |   length = 1     |           port         |
  1372.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1373.  
  1374.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1375.  |  type = PORT     |   length > 1     |    reserved     |    reserved     |
  1376.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1377.  |                   port                ...
  1378.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1379.  
  1380.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1381.  |  type = CNAME |    length     | user    and domain name        ...
  1382.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1383.  
  1384.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1385.  |  type = EMAIL |    length     | electronic mail address    ...
  1386.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1387.  
  1388.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1389.  
  1390. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 24]
  1391.  
  1392.  
  1393. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1394.  
  1395.  |  type = NAME     |    length     | common name of source    ...
  1396.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1397.  
  1398.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1399.  |   type = LOC     |    length     | geographic location of site    ...
  1400.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1401.  
  1402.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1403.  |   type = TXT     |    length     | text    describing source    ...
  1404.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1405.  
  1406.  
  1407. The SDES option    provides a mapping  between a numeric source identifier     and
  1408. one or more items identifying  the source.[Several attributes were  combined
  1409. into one  option so  that the  receiver    does  not have    to perform  multiple
  1410. mappings from identifiers to site data structures.]  For those    applications
  1411. where the size of a multi-item SDES option would be a concern, multiple    SDES
  1412. options    may be    formed with  subsets of     the items  to be  sent    in  separate
  1413. packets.
  1414.  
  1415. A bridge uses an identifier  value of zero within  the SDES option to  refer
  1416. to itself rather  than content    sources    bridged     by it.       For each  content
  1417. source,    a bridge forwards  the SDES information     received from that  source,
  1418. but changes the    SDES source identifier to the value used in the    CSRC  option
  1419. when identifying that content source.  A bridge    that contributes local    data
  1420. to outgoing packets  should select  another non-zero  source identifier     for
  1421. that traffic and send CSRC and SDES options for    it.
  1422.  
  1423. Translators do not modify or insert SDES  options.  The    end system  performs
  1424. the same  mapping  it  uses  to     identify  the    content     sources  (that     is,
  1425. the combination    of  network source,  synchronization source  and the  source
  1426. identifier within this SDES option) to    identify a particular source.    SDES
  1427. information is    specific to  a particular  channel, unless  a profile  or  a
  1428. higher-layer control protocol defines that all packets with the    same  source
  1429. identifier (network and     transport-level source    addresses  and the  optional
  1430. SSRC value)  from a  set of  channels defined  by the  control protocol     are
  1431. described by the same SDES.
  1432.  
  1433. Currently, the items listed in    Table 2    are defined.   Each has    a  structure
  1434. similar    to that    of RTCP    and RTP     options, that is, a type field    followed  by
  1435. a length field,    measured  in multiples of  four    octets.      No final bit    (see
  1436. Section    5.2) is    needed since  the overall length is known.   Text items     are
  1437. encoded    according to  the rules    in  Section 4.     All of     the SDES items     are
  1438. optional; however, if quality-of-service monitoring is to be used, one    ADDR
  1439. item and the PORT item are mandatory, as described for the QOS option.    Only
  1440. the TXT    item is    expected to change during the duration of a session.  Option
  1441. types 128 through 255 are  reserved for    private    or experimental     extensions.
  1442. Items are padded with  the binary value     zero to the  next multiple of    four
  1443. octets.     Each item may appear only once    unless otherwise noted.
  1444.  
  1445. A more detailed    description of the content of some of these items follows:
  1446.  
  1447.  
  1448. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 25]
  1449.  
  1450.  
  1451. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1452.  
  1453.  
  1454.  
  1455.       type     value    description
  1456.       ADDR     1    network    address    of source
  1457.       PORT     2    source port
  1458.       CNAME     4    canonical user and host    identifier,
  1459.             e.g., ``doe@sleepy.megacorp.com'' or
  1460.             ``sleepy.megacorp.com''
  1461.       EMAIL     5    user's electronic mail address,
  1462.             e.g., ``John.Doe@megacorp.com''
  1463.       NAME     6    common name describing the source,
  1464.             e.g.,``John Doe, Bit Recycler, Megacorp''
  1465.       LOC     8    geographic user    location,
  1466.             e.g., ``Rm.  2A244, Murray Hill, NJ''
  1467.       TXT     16    text describing    the source,
  1468.             e.g., ``out for    lunch''
  1469.  
  1470.  
  1471.               Table 2:    Summary    of SDES    items
  1472.  
  1473. ADDR: This item     contains the network  address of the  source, for  example,
  1474.     the    IP version  4 address or an NSAP.  The address is carried in  binary
  1475.     form,  not as  ``dotted decimal''  or similar  human-readable form.       A
  1476.     source  may    send  several  network    addresses,  but    only  one  for    each
  1477.     address type  value.  Address  types are identified     by the    Domain    Name
  1478.     Service Resource Record (RR)  type,    as specified in    the current  edition
  1479.     of the Assigned Numbers RFC.
  1480.  
  1481. PORT: If the  length field is one, the    transport selector, such as the     UDP
  1482.     port number, is carried as    octets three and four in the first and    only
  1483.     word of  the item.     If  the length    field  is greater  than    one,  octets
  1484.     three and  four are     zero and the  transport selector  appears in  words
  1485.     two    and  following of  this    item,  in network byte    order.     The  figure
  1486.     shows the use  of the PORT item  for the TCP and  UDP protocols.   There
  1487.     must  be no     more than  one    PORT  item  in an  SDES    option.       The    PORT
  1488.     item  should immediately  precede  any ADDR     items.[Multiple  concurrent
  1489.     transport  addresses  are not  meaningful.       The    ordering  simplifies
  1490.     processing at  the receiver,  as the  consecutive octet  string of    PORT
  1491.     followed by    the first ADDR can be used as a    globally  unique identifier.
  1492.     The    transport protocol does     not need to be    identified, as the  receiver
  1493.     will only see one type of transport    protocol for a session.]
  1494.  
  1495. CNAME: The CNAME item must have    the format ``user@host'' or  ``host'', where
  1496.     ``host'' is    the fully qualified  domain name of the    host from which     the
  1497.     real-time data  originates,    formatted according  to    the rules  specified
  1498.     in RFC  1034,  RFC 1035  and Section  2.1 of  RFC 1123.    The  ``host''
  1499.     form  may be  used if  a user  name     is not     available, for     example  on
  1500.     single-user    systems.  The  user name should    be in a    form that a  program
  1501.     such as  ``finger''    or  ``talk'' could use,     i.e., it  typically is     the
  1502.     login name    rather than  the ``real     life''    name.    Note  that the    host
  1503.     name is not    necessarily identical to the electronic    mail address  of the
  1504.  
  1505.  
  1506. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 26]
  1507.  
  1508.  
  1509. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1510.  
  1511.     participant.  The latter is    provided through the EMAIL item.
  1512.  
  1513. LOC: Depending    on  the      application,    different  degrees  of    detail     are
  1514.     appropriate     for this  item.    For    conference  applications,  a  string
  1515.     like  ``Murray Hill,  New  Jersey''    may  be    sufficient,  while,  for  an
  1516.     active badge system,  strings like ``Room 2A244,  AT&T BL MH'' might  be
  1517.     appropriate.  The degree of    detail is left to the  implementation and/or
  1518.     user, but format and content may be    prescribed by a    profile.
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524. 6.3 BYE: Goodbye
  1525.  
  1526.  
  1527.  0             1             2             3
  1528.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1529. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1530. |F|    BYE    | length = 1    |   content source identifier    |
  1531. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1532.  
  1533. The BYE    option indicates that a    particular session participant is no  longer
  1534. active.     A bridge sends    BYE options with a (non-zero) content source  value.
  1535. An identifier  value of     zero indicates     that the  source indicated  by     the
  1536. synchronization    source    (SSRC) option  and transport  address is  no  longer
  1537. active.     If a  bridge shuts down, it should  first send    BYE options for     all
  1538. content    sources    it  handles, followed  by a  BYE option     with an  identifier
  1539. value of zero.     Each  RTCP message can     contain one or     more BYE  messages.
  1540. Multiple identifiers  in a  single  BYE    option    are  not allowed,  to  avoid
  1541. ambiguities between the    special    value of zero and any necessary    padding.
  1542.  
  1543.  
  1544.  
  1545. 6.4 QOS: Quality of service measurement
  1546.  
  1547.  
  1548.   0              1              2              3
  1549.   0 1 2    3 4 5 6    7 8 9 0    1 2 3 4    5 6 7 8    9 0 1 2    3 4 5 6    7 8 9 0    1
  1550.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1551.  |F|     QOS     |    length     |    reserved     |    reserved     |
  1552.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1553.  |             packets expected             |
  1554.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1555.  |             packets received             |
  1556.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1557.  |    minimum delay (seconds)     |    minimum delay (fraction)     |
  1558.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1559.  |    maximum delay (seconds)     |    maximum delay (fraction)     |
  1560.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1561.  |    average delay (seconds)     |    average delay (fraction)     |
  1562.  
  1563.  
  1564. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 27]
  1565.  
  1566.  
  1567. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1568.  
  1569.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1570.  |  type = PORT     |    length     |   transport address        ...
  1571.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1572.  |  type = ADDR     |    length     |    reserved     | address type     |
  1573.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1574.  |               network-layer address            ...
  1575.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1576.  
  1577.  
  1578. The QOS     option     conveys  statistics  of  a  single  synchronization  source
  1579. belonging to the channel  identified by    the  multicast address,     destination
  1580. port and channel identifier.   The synchronization  source is identified  by
  1581. appending the first of the ADDR    items  together    with the PORT item from     the
  1582. SDES option.   These SDES  items are appended  directly    to the    fixed-length
  1583. part of    the QOS    option,    with PORT preceding ADDR. For a    description of these
  1584. items, see the SDES option.
  1585.  
  1586. If the QOS option is used  in reverse control packets, the destination    port
  1587. number identifies the channel, along with the channel identifier.  For    that
  1588. reason,    every  multicast group    should be  associated with  a unique  source
  1589. port.
  1590.  
  1591. The other fields of the    option    contain    the number of packets received,     the
  1592. number of packets  expected, the minimum  delay, the  maximum delay and     the
  1593. average    delay.    The expected number of packets may be computed according  to
  1594. the algorithm in Section A.5.  The delay measures are in units of 1/65536 of
  1595. a second, that is,  with the same resolution as     the timestamp in the  fixed
  1596. RTP header.
  1597.  
  1598. A single RTCP packet  may contain several QOS  options.     It  is    left to     the
  1599. implementor to decide how  often to transmit QOS  options and which  sources
  1600. are to be included.
  1601.  
  1602.  
  1603.  
  1604.  
  1605. 7 Security Considerations
  1606.  
  1607.  
  1608. Without    the  use of  the  security options  described  in section  5.4,     RTP
  1609. suffers    from the same security deficiencies as the underlying protocols, for
  1610. example, the ability of     an impostor to    fake  source or    destination  network
  1611. addresses, or to change    header or  payload without detection.  For  example,
  1612. the SDES fields    may be used to impersonate another participant.
  1613.  
  1614. IP multicast provides no direct    means for a sender to know all the receivers
  1615. of the    data sent.    RTP  options  make it  easy  for all  participants  in
  1616. a session  to identify    themselves;  if    deemed    important for  a  particular
  1617. application, it     is the     responsibility    of  the    application  writer to    make
  1618. listening without identification difficult.   It  should be noted,  however,
  1619. that privacy of    the payload can    generally be assured only by encryption.
  1620.  
  1621.  
  1622. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 28]
  1623.  
  1624.  
  1625. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1626.  
  1627. The periodic transmission of session messages may make it possible to detect
  1628. denial-of-service attacks, as the receiver  can    detect the absence of  these
  1629. expected messages.
  1630.  
  1631. Unlike for other  data,    ciphertext-only     attacks may be     more _________     for
  1632. compressed audio  and video  sources.    Such  data is  very close  to  white
  1633. noise, making  statistics-based    ciphertext-only     attacks  difficult.    Even
  1634. without    message     integrity  check  options,  it     may  be  difficult  for  an
  1635. attacker to  detect  automatically when     he  or     she has  found     the  secret
  1636. cryptographic key  since  the  bit  pattern  after  correct  decryption     may
  1637. not look  significantly    different  from    one  decrypted with  the wrong    key.
  1638. However, the session information is  more or less constant and    predictable,
  1639. allowing known-plaintext  attacks.    Chosen-plaintext    attacks     appear,  in
  1640. general, to be difficult.
  1641.  
  1642. The integrity of the timestamp in the  fixed RTP header    can be protected  by
  1643. the message integrity options.    If  clocks are known to    be synchronized,  an
  1644. attacker only has a very limited time window of    maybe a    few seconds every 18
  1645. hours to replay    recorded RTP without detection by the receiver.
  1646.  
  1647. Key  distribution  and     certificates  are   outside  the   scope  of    this
  1648. document.
  1649.  
  1650.  
  1651.  
  1652. 8 RTP over Network and Transport Protocols
  1653.  
  1654.  
  1655. This section  describes     issues     specific to  carrying    RTP  packets  within
  1656. particular network and transport protocols.
  1657.  
  1658.  
  1659. 8.1 Defaults
  1660.  
  1661.  
  1662. The following rules apply unless superseded by protocol-specific subsections
  1663. in this    section.  The rules apply to both forward and reverse RTP packets.
  1664.  
  1665. RTP packets contain no length field or other delineation, so that a  framing
  1666. mechanism is  needed  if  they    are carried  in     underlying  protocols    that
  1667. provide    the  abstraction of  a continuous  bit stream  rather than  messages
  1668. (packets).  TCP    is an  example of such a protocol.   Framing is    also  needed
  1669. if the underlying  protocol may    contain     padding so that  the extent of     the
  1670. RTP payload cannot  be determined.    For these     cases,    each  RTP packet  is
  1671. prefixed by a 32-bit framing field  containing the length of the RTP  packet
  1672. measured in octets,  not including  the    framing     field itself.      If an     RTP
  1673. packet traverses a path    over a mixture of octet-stream and  message-oriented
  1674. protocols, each    RTP-level bridge between these protocols is responsible     for
  1675. adding and removing the    framing    field.
  1676.  
  1677. A profile may determine    that this framing method is to be used even when RTP
  1678.  
  1679.  
  1680. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 29]
  1681.  
  1682.  
  1683. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1684.  
  1685. is carried in protocols    that do     provide framing in order to allow  carrying
  1686. several    RTP packets in    one lower-layer    protocol  data unit,  such as a     UDP
  1687. packet.      Carrying several RTP    packets    in one    network    or transport  packet
  1688. reduces    header overhead    and  may simplify synchronization between  different
  1689. streams.
  1690.  
  1691.  
  1692.  
  1693. 8.2 ST-II
  1694.  
  1695.  
  1696. When used in conjunction  with RTP, ST-II [11]    service    access ports  (SAPs)
  1697. have a length of 16  bits.  The     next protocol field (``NextPCol'',  Section
  1698. 4.2.2.10 in RFC    1190) is used to distinguish two encapsulations    of RTP    over
  1699. ST-II. The first uses NextPCol value TBD and directly places the RTP  packet
  1700. into the ST-II data area.  If NextPCol value TBD is used, the RTP  header is
  1701. preceded by a 32-bit  header shown below.   The     octet count determines     the
  1702. number of octets  in the  RTP header  and payload to  be checksummed.     The
  1703. 16-bit checksum    uses the TCP and UDP checksum algorithm.
  1704.  
  1705.  
  1706.   0              1              2              3
  1707.   0 1 2    3 4 5 6    7 8 9 0    1 2 3 4    5 6 7 8    9 0 1 2    3 4 5 6    7 8 9 0    1
  1708.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1709.  | count of octets to be checked |         check sum         |
  1710.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1711.  |     RTP packet (fixed header, options and payload)        ...
  1712.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1713.  
  1714.  
  1715. A Implementation Notes
  1716.  
  1717.  
  1718. We describe aspects of the receiver  implementation in this section.   There
  1719. may be other implementation methods that are faster in particular  operating
  1720. environments or    have other advantages.     These implementation notes are     for
  1721. informational purposes only.
  1722.  
  1723. The  following    definitions  are  used    for  all  examples;   the  structure
  1724. definitions are    valid for 32-bit big-endian architectures only.     Bit  fields
  1725. are assumed to be packed tightly, with no additional padding.
  1726.  
  1727.  
  1728.  
  1729. #include <sys/types.h>
  1730.  
  1731. typedef    double CLOCK_t;
  1732.  
  1733. typedef    enum {
  1734.   RTP_CSRC   = 0,
  1735.   RTP_SSRC   = 1,
  1736.   RTP_SDST   = 2,
  1737.  
  1738. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 30]
  1739.  
  1740.  
  1741. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1742.  
  1743.   RTP_BOS    = 3,
  1744.   RTP_ENC    = 8,
  1745.   RTP_MIC    = 9,
  1746.   RTP_MICA   = 10,
  1747.   RTP_MICK   = 11,
  1748.   RTP_MICS   = 12,
  1749.   RTP_FMT    = 32,
  1750.   RTP_SDES   = 34,
  1751.   RTP_BYE    = 35,
  1752.   RTP_QOS    = 36
  1753. } rtp_option_t;
  1754.  
  1755. typedef    struct {
  1756.   unsigned int ver:2;       /* version number */
  1757.   unsigned int channel:6;  /* channel id */
  1758.   unsigned int o:1;       /* option present */
  1759.   unsigned int s:1;       /* sync bit */
  1760.   unsigned int format:6;   /* content type */
  1761.   u_short seq;           /* sequence number */
  1762.   u_long  ts;           /* time stamp */
  1763. } rtp_hdr_t;
  1764.  
  1765. typedef    union {
  1766.   struct {
  1767.     int    final:1;       /* final option */
  1768.     int    type:7;           /* option type */
  1769.     u_char length;       /* length, including    type/length */
  1770.     short id[1];
  1771.   } csrc;
  1772.   /* ... */
  1773. } rtp_t;
  1774.  
  1775.  
  1776.  
  1777. A.1 Timestamp Recovery
  1778.  
  1779.  
  1780. For some applications  it is  useful to     have the  receiver reconstruct     the
  1781. sender's high-order  bits of  the  NTP timestamp  from the  received  32-bit
  1782. RTP timestamp.      The following     code uses  double-precision floating  point
  1783. numbers    for  whole numbers  with a  48-bit range.    Other type     definitions
  1784. of CLOCK_t may be  appropriate for different  operating    environments,  e.g.,
  1785. 64-bit architectures  or systems  with slow  floating point  support.     The
  1786. routine    applies    to any clock frequency,    not just the RTP value of 65,536 Hz,
  1787. and any    clock starting    point.    It  will reconstruct the correct  high-order
  1788. bits as    long as    the local clock     now is    within one half    of wrap-around    time
  1789. of the 32-bit timestamp, e.g., approximately 9.2 hours for RTP timestamps.
  1790.  
  1791.  
  1792.  
  1793. #include <math.h>
  1794.  
  1795.  
  1796. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 31]
  1797.  
  1798.  
  1799. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1800.  
  1801. #define    MOD32bit 4294967296.
  1802. #define    MAX31bit 0x7fffffff
  1803.  
  1804. CLOCK_t    clock_extend(ts, now)
  1805. u_long ts;    /* in: timestamp,    low-order 32 bits */
  1806. CLOCK_t    now;  /* in: current local time    */
  1807. {
  1808.   u_long high, low;   /* high and low order bits of 48-bit clock */
  1809.  
  1810.   low  = fmod(now, MOD32bit);
  1811.   high = now / MOD32bit;
  1812.  
  1813.   if (low > ts)    {
  1814.     if (low - ts > MAX31bit) high++;
  1815.   }
  1816.   else {
  1817.     if (ts - low > MAX31bit) high--;
  1818.   }
  1819.   return high *    MOD32bit + ts;
  1820. } /* extend_timestamp */
  1821.  
  1822.  
  1823.  
  1824.  
  1825. Using the full timestamp internally has    the advantage that the remainder  of
  1826. the receiver code does not have    to be concerned    with modulo arithmetic.     The
  1827. current    local time  does not  have to be  derived directly  from the  system
  1828. clock for every    packet;    a clock     based on samples, e.g., incremented by     the
  1829. nominal    audio  frame duration,    is sufficient.      The whole  seconds  within
  1830. NTP time stamps    can  be    obtained by  adding 2208988800 to  the value of     the
  1831. standard Unix  clock (generated,  for example,    by  the    gettimeofday  system
  1832. call), which starts from the  year 1970.  For  the RTP time stamp, only     the
  1833. least significant 16 bits of the second    are used.
  1834.  
  1835.  
  1836. A.2 Detecting the Beginning of a Synchronization Unit
  1837.  
  1838.  
  1839. RTP packets contain a bit flag indicating the end of a synchronization unit.
  1840. The following code  fragment determines,  based     on sequence numbers,  if  a
  1841. packet is the  beginning of a  synchronization unit.   It  assumes that     the
  1842. packet header has been converted to host byte order.
  1843.  
  1844.  
  1845. static u_long seq_eos;
  1846. rtp_hdr_t *h;
  1847. static int flag;
  1848.  
  1849. if (h->s) {
  1850.   flag      = 1;
  1851.   seq_eos = h->seq;
  1852. }
  1853.  
  1854. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 32]
  1855.  
  1856.  
  1857. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1858.  
  1859. /* handle wrap-around of sequence number */
  1860. else if    (flag && (h->seq - seq_eos < 32768)) {
  1861.   flag = 0;
  1862.   /* handle beginning of synchronization unit */
  1863. }
  1864.  
  1865.  
  1866.  
  1867. A.3 Demultiplexing and Locating    the Synchronization Source
  1868.  
  1869.  
  1870. The combination     of  destination  address,   destination  port    and  channel
  1871. identifier determines the channel.  For    each channel, the receiver maintains
  1872. a list of all sources, content and synchronization sources alike, in a table
  1873. or other suitable data structure.   Synchronization sources are    stored    with
  1874. a content source value of  zero.  When an  RTP packet arrives, the  receiver
  1875. determines its network    source address and  port (from information  returned
  1876. by the operating system), synchronization  source (SSRC    option)    and  content
  1877. source(s) (CSRC     option).    To    locate    the  table entry  containing  timing
  1878. information, mapping from content descriptor  to actual    encoding, etc.,     the
  1879. receiver sets the content source to zero and locates a table entry based  on
  1880. the triple (transport source address, and synchronization source identifier,
  1881. 0).
  1882.  
  1883. The receiver identifies     the contributors to  the packet  (for example,     the
  1884. speaker    who is    heard in  the packet) through  the list     of content  sources
  1885. carried    in the CSRC option.   To locate    the  table entry, it matches on     the
  1886. triple (network    address    and port, synchronization source identifier, content
  1887. source).
  1888.  
  1889. Note that  since  network  addresses  are  only     generated  locally  at     the
  1890. receiver, the receiver can choose whatever format seems    most appropriate for
  1891. matching.  For example,    a Berkeley Unix-based system may use struct sockaddr
  1892. data types if it expects network sources with non-IP addresses.
  1893.  
  1894.  
  1895. A.4 Parsing RTP    Options
  1896.  
  1897.  
  1898. The following  code  segment  walks  through  the  RTP options,      preventing
  1899. infinite loops due to zero and invalid length fields.  Structure definitions
  1900. are valid for big-endian architectures only.
  1901.  
  1902.  
  1903. u_long len;      /* length of RTP packet in bytes */
  1904. u_long *pt;      /* pointer */
  1905. rtp_hdr_t *h;      /* fixed header */
  1906. rtp_t *r;      /* options */
  1907.  
  1908. if (h->o) {
  1909.   for (pt = (u_long *)(h+1);; pt += r->csrc.length) {
  1910.  
  1911.  
  1912. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 33]
  1913.  
  1914.  
  1915. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1916.  
  1917.     r =    (rtp_t *)pt;
  1918.  
  1919.     /* invalid length field */
  1920.     if ((char *)pt - (char *)h > len ||    r->csrc.length == 0) return -1;
  1921.  
  1922.     switch(r->csrc.type) {
  1923.       case RTP_BYE:
  1924.     /* handle BYE option */
  1925.     break;
  1926.       case RTP_CSRC:
  1927.     /* handle CSRC option */
  1928.     break;
  1929.  
  1930.     /* ... */
  1931.  
  1932.       default:
  1933.     /* undefined option */
  1934.     break;
  1935.     }
  1936.     if (r->csrc.final) break;
  1937.   }
  1938. }
  1939.  
  1940.  
  1941.  
  1942. A.5 Determining    the Expected Number of RTP Packets
  1943.  
  1944.  
  1945. The number of packets expected can  be computed    by the receiver    by  tracking
  1946. the first  sequence  number  received  (seq0),     the  last  sequence  number
  1947. received, seq, and the number of complete sequence number cycles:
  1948.  
  1949.  
  1950. expected = cycles * 65536 + seq    - seq0 + 1;
  1951.  
  1952.  
  1953. The cycle count    is updated for each packet, where seq_prior is the  sequence
  1954. number of the prior packet:
  1955.  
  1956.  
  1957.  
  1958. unsigned long seq, seq_prior;
  1959.  
  1960. if (seq    - seq_prior > 65536)
  1961.   cycle++;
  1962. else if    (seq - seq_prior > 32768)
  1963.   cycle--;
  1964.  
  1965. seq_prior = seq;
  1966.  
  1967.  
  1968.  
  1969.  
  1970. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 34]
  1971.  
  1972.  
  1973. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  1974.  
  1975. Acknowledgments
  1976.  
  1977.  
  1978. This  memorandum  is  based  on     discussions  within  the  IETF     audio-video
  1979. transport working group    chaired    by Stephen Casner.  The    current    protocol has
  1980. its origins in    the Network  Voice Protocol  and the  Packet Video  Protocol
  1981. (Danny Cohen  and  Randy Cole)    and  the  protocol implemented    by  the     vat
  1982. application (Van  Jacobson and    Steve McCanne).       Stuart Stubblebine  (ISI)
  1983. helped with the    security aspects of RTP. Ron Frederic (Xerox PARC)  provided
  1984. extensive editorial assistance.
  1985.  
  1986.  
  1987.  
  1988. B Addresses of Authors
  1989.  
  1990.  
  1991. Stephen    Casner
  1992. USC/Information    Sciences Institute
  1993. 4676 Admiralty Way
  1994. Marina del Rey,    CA 90292-6695
  1995. telephone:  +1 310 822 1511 (extension 153)
  1996. electronic mail:  casner@isi.edu
  1997.  
  1998.  
  1999. Henning    Schulzrinne
  2000. AT&T Bell Laboratories
  2001. MH 2A244
  2002. 600 Mountain Avenue
  2003. Murray Hill, NJ    07974-0636
  2004. telephone:  +1 908 582 2262
  2005. facsimile:  +1 908 582 5809
  2006. electronic mail:  hgs@research.att.com
  2007.  
  2008.  
  2009.  
  2010. References
  2011.  
  2012.  
  2013.  [1] D.    E.  Comer, _______________  ____ ______, vol.  1. Englewood  Cliffs,
  2014.      New Jersey:  Prentice Hall, 1991.
  2015.  
  2016.  [2] J.     Postel, ``Internet protocol,''     Network Working  Group    Request     for
  2017.      Comments RFC 791, Information Sciences Institute, Sept. 1981.
  2018.  
  2019.  [3] International  Standards    Organization,  ``ISO/IEC  DIS    10646-1:1993
  2020.      information technology -- universal multiple-octet    coded  character set
  2021.      (UCS) -- part I: Architecture and basic multilingual plane,'' 1993.
  2022.  
  2023.  [4] The  Unicode Consortium,  ___ _______  ________.  New York,  New  York:
  2024.      Addison-Wesley, 1991.
  2025.  
  2026.  [5] D.     L. Mills,  ``Network time  protocol (version  3) --  specification,
  2027.  
  2028. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 35]
  2029.  
  2030.  
  2031. INTERNET-DRAFT        draft-ietf-avt-rtp-03.txt      September 15,    1993
  2032.  
  2033.      implementation  and  analysis,''  Network    Working     Group    Request     for
  2034.      Comments RFC 1305,    University of Delaware,    Mar. 1992.
  2035.  
  2036.  [6] S.     Kent,    ``Understanding     the  Internet    certification system,''      in
  2037.      ___________  __ ___  _____________    __________  __________ ______,    (San
  2038.      Francisco,    California),  pp. BAB--1 -- BAB--10, Internet Society,    Aug.
  2039.      1993.
  2040.  
  2041.  [7] D.    Balenson, ``Privacy enhancement    for internet electronic    mail:    Part
  2042.      III:  Algorithms,    modes,    and  identifiers,''  Network  Working  Group
  2043.      Request for Comments RFC 1423, IETF, Feb. 1993.
  2044.  
  2045.  [8] V.     L. Voydock  and S.  T.    Kent,  ``Security  mechanisms in  high-level
  2046.      network  protocols,'' ___    _________ _______,  vol. 15,  pp.  135--171,
  2047.      June 1983.
  2048.  
  2049.  [9] J.    Kaliski,  Burton S., ``The  MD2    message-digest algorithm,''  Network
  2050.      Working Group  Request for     Comments RFC 1319,  RSA Laboratories,    Apr.
  2051.      1992.
  2052.  
  2053. [10] R.    Rivest,    ``The MD5 message-digest algorithm,'' Network  Working Group
  2054.      Request for Comments RFC 1321, IETF, Apr. 1992.
  2055.  
  2056. [11] C.     Topolcic, S.  Casner,    C. Lynn,  Jr.,    P.  Park, and  K.  Schroder,
  2057.      ``Experimental internet  stream protocol, version 2 (ST-II),''  Network
  2058.      Working  Group  Request   for  Comments  RFC  1190,  BBN  Systems     and
  2059.      Technologies, Oct.    1990.
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086. H. Schulzrinne/S. Casner         Expires 11/01/93           [Page 36]
  2087.